package nc.ui.baoyin.report;

import java.awt.Container;
import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;

import nc.ui.pub.beans.UIDialog;
import nc.vo.pub.lang.UFDouble;

@SuppressWarnings("serial")
public class CenterUI extends JFrame {

	@SuppressWarnings("deprecation")
	public CenterUI() {
		setCenterLoc();
	}

	public void setCenterLoc() {
		Toolkit kit = Toolkit.getDefaultToolkit();
		Dimension dim = kit.getScreenSize();
		int scrhig = (int) dim.getHeight();
		int scrwid = (int) dim.getWidth();
		int uiHig = scrhig * 3 / 4;
		int uiWid = scrwid * 3 / 4;
		setBounds((scrwid - uiWid) / 2, (scrhig - uiHig) / 2, uiWid, uiHig);
	}
	
	public void setCenterLoc(int a,int b) {
		Toolkit kit = Toolkit.getDefaultToolkit();
		Dimension dim = kit.getScreenSize();
		int scrhig = (int) dim.getHeight();
		int scrwid = (int) dim.getWidth();
		int uiHig = scrhig * a/b;
		int uiWid = scrwid * a/b;
		setBounds((scrwid - uiWid) / 2, (scrhig - uiHig) / 2, uiWid, uiHig);
	}
}
